package com.zhentao.dataintegrity.domain.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@TableName("di_execution_record")
public class ExecutionRecord {

    @TableId(type = IdType.AUTO)
    private Long id;

    private Long taskId;
    private String executionId;
    private String triggerType; // SCHEDULED, MANUAL
    private String executionStatus; // RUNNING, SUCCESS, FAILED, CANCELLED
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private Integer durationSeconds;
    private LocalDate dataRangeStart;
    private LocalDate dataRangeEnd;
    private BigDecimal totalDiffRmb;
    private BigDecimal totalDiffUsd;
    private String errorMessage;
    private String executionDetails; // JSON格式

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public Long getTaskId() { return taskId; }
    public void setTaskId(Long taskId) { this.taskId = taskId; }

    public String getExecutionId() { return executionId; }
    public void setExecutionId(String executionId) { this.executionId = executionId; }

    public String getTriggerType() { return triggerType; }
    public void setTriggerType(String triggerType) { this.triggerType = triggerType; }

    public String getExecutionStatus() { return executionStatus; }
    public void setExecutionStatus(String executionStatus) { this.executionStatus = executionStatus; }

    public LocalDateTime getStartTime() { return startTime; }
    public void setStartTime(LocalDateTime startTime) { this.startTime = startTime; }

    public LocalDateTime getEndTime() { return endTime; }
    public void setEndTime(LocalDateTime endTime) { this.endTime = endTime; }

    public Integer getDurationSeconds() { return durationSeconds; }
    public void setDurationSeconds(Integer durationSeconds) { this.durationSeconds = durationSeconds; }

    public LocalDate getDataRangeStart() { return dataRangeStart; }
    public void setDataRangeStart(LocalDate dataRangeStart) { this.dataRangeStart = dataRangeStart; }

    public LocalDate getDataRangeEnd() { return dataRangeEnd; }
    public void setDataRangeEnd(LocalDate dataRangeEnd) { this.dataRangeEnd = dataRangeEnd; }

    public BigDecimal getTotalDiffRmb() { return totalDiffRmb; }
    public void setTotalDiffRmb(BigDecimal totalDiffRmb) { this.totalDiffRmb = totalDiffRmb; }

    public BigDecimal getTotalDiffUsd() { return totalDiffUsd; }
    public void setTotalDiffUsd(BigDecimal totalDiffUsd) { this.totalDiffUsd = totalDiffUsd; }

    public String getErrorMessage() { return errorMessage; }
    public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; }

    public String getExecutionDetails() { return executionDetails; }
    public void setExecutionDetails(String executionDetails) { this.executionDetails = executionDetails; }

    public LocalDateTime getCreatedTime() { return createdTime; }
    public void setCreatedTime(LocalDateTime createdTime) { this.createdTime = createdTime; }
}
